//
//  ViewDeckController.m
//  EnglishRemix
//
//  Created by Cong Wang on 2014-02-25.
//  Copyright (c) 2014 Cong Wang. All rights reserved.
//

#import "ViewDeckController.h"
#import "MainViewController.h"
#import "ListViewController.h"
#import "ScanViewController.h"
#import "IIWrapController.h"
#import "IIViewDeckController.h"

@interface ViewDeckController ()

@end

@implementation ViewDeckController

@synthesize mainController = _mainController;
@synthesize listController = _listController;
@synthesize scanController = _scanController;
@synthesize iiViewDeckController = _iiViewDeckController;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        // Create the center Controller
    }
    return self;
}

-(id) init{
    
    self = [super init];
    
    if (self){
        _mainController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
        _listController = [[ListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
        _scanController = [[ScanViewController alloc] initWithNibName:@"ScanViewController" bundle:nil];
        
        _iiViewDeckController = [[IIViewDeckController alloc] initWithCenterViewController:[[UINavigationController alloc]                                                                                                                                                                                                        initWithRootViewController:_mainController] leftViewController:_listController rightViewController:_scanController];
        
        _iiViewDeckController.centerhiddenInteractivity = IIViewDeckCenterHiddenNotUserInteractiveWithTapToClose;
        _iiViewDeckController.delegateMode = IIViewDeckDelegateAndSubControllers;
        _iiViewDeckController.navigationController.navigationBarHidden = TRUE;
        
        self = [[ViewDeckController alloc] initWithViewController:_iiViewDeckController];
        
    }
    
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
